package org.example;

public class MetroLine implements Comparable<MetroLine> {
    private final String number;
    private final String name;

    public MetroLine(String number, String name) {
        this.number = number;
        this.name = name;
    }

    public String getNumber() {
        return number;
    }

    public String getName() {
        return name;
    }

    public String toString() {
        return getNumber() + " " + getName();
    }

    @Override
    public int compareTo(MetroLine o) {
        return getName().compareTo(o.getName());
    }
}
